// 插件文件
import { App } from 'vue';

import LiButton from '@/components/li-button/li-button.vue';
import LiColorSelect from '@/components/li-color-select/li-color-select.vue';
import LiDivider from '@/components/li-divider/li-divider.vue';
import LiGrid from '@/components/li-grid/li-grid.vue';
import LiGridItem from '@/components/li-grid/li-grid-item.vue';
import LiIcon from '@/components/li-icon/li-icon.vue';
import LiLabel from '@/components/li-label/li-label.vue';
import LiLayout from '@/components/li-layout/li-layout.vue';
import LiLayoutContent from '@/components/li-layout/li-layout-content.vue';
import LiLayoutFooter from '@/components/li-layout/li-layout-footer.vue';
import LiLayoutHeader from '@/components/li-layout/li-layout-header.vue';
import LiLayoutSider from '@/components/li-layout/li-layout-sider.vue';
import LiMenu from '@/components/li-menu/li-menu.vue';
import LiSubMenu from '@/components/li-menu/li-sub-menu.vue';
import LiMenuItem from '@/components/li-menu/li-menu-item.vue';
import LiMenuGroup from '@/components/li-menu/li-menu-group.vue';
import LiRow from '@/components/li-row-col/li-row.vue';
import LiCol from '@/components/li-row-col/li-col.vue';
import LiTransition from '@/components/li-transition/li-transition.vue';

const components = [
    LiButton,
    LiColorSelect,
    LiDivider,
    LiGrid,
    LiGridItem,
    LiIcon,
    LiLabel,
    LiLayout,
    LiLayoutContent,
    LiLayoutFooter,
    LiLayoutHeader,
    LiLayoutSider,
    LiMenu,
    LiSubMenu,
    LiMenuItem,
    LiMenuGroup,
    LiRow,
    LiCol,
    LiTransition
]; // 其他自定义组件也加入数组

const install = (app: App) => {
    components.forEach(component => {
        // component.install(app, component);
        app.component(component.name, component);
    });
};

export default { install };

export {
    LiButton,
    LiColorSelect,
    LiDivider,
    LiGrid,
    LiGridItem,
    LiIcon,
    LiLabel,
    LiLayout,
    LiLayoutContent,
    LiLayoutFooter,
    LiLayoutHeader,
    LiLayoutSider,
    LiMenu,
    LiSubMenu,
    LiMenuItem,
    LiMenuGroup,
    LiRow,
    LiCol,
    LiTransition
};
